import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/admin/login',
    name: 'admin/login',
    component: () => import( '../views/admin/LoginView.vue')
  },
  {
    path: '/admin/default',
    name: 'admin/default',
    component: () => import( '../views/admin/DefaultView.vue'),
    children:[
      {
        path: '/admin/rbac/user',
        name: 'admin/rbac/user',
        component: () => import( '../views/admin/rbac/UserView.vue')
      },
      {
        path: '/admin/rbac/role',
        name: 'admin/rbac/role',
        component: () => import( '../views/admin/rbac/RoleView.vue')
      },
      {
        path: '/admin/ff/form',
        name: 'admin/ff/form',
        component: () => import( '../views/admin/flowform/FormView.vue')
      },
      {
        path: '/admin/ff/flow',
        name: 'admin/ff/flow',
        component: () => import( '../views/admin/flowform/FlowView.vue')
      },
      {
        path: '/test/signalr',
        name: 'test/signalr',
        component: () => import( '../views/admin/test/SignalRView.vue')
      }
    ]
  },
  
      {
        path: '/admin/fx/rm',
        name: 'admin/fx/rm',
        component: () => import( '../views/admin/fx/RoleMenuView.vue')
      }
  
]

const router = new VueRouter({
  routes
})

export default router
